<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>上传视频</title>
</head>
<body>
<dl class="row">
    <dt class="tit">
        <label>视频上传</label>
    </dt>
    <!--{$goodsInfo.original_img}-->
    <dd class="opt">
        <div class="input-file-show">
            <div>
                <input type="file" name="FileUpload" id="FileUpload">
                <a class="layui-btn layui-btn-mini" id="btn_uploadimg">上传视频</a>
            </div>
            
 
        </div>
 
    </dd>
</dl>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
 
    // ajax上传视频返回路径
    $("#btn_uploadimg").click(function(){
        var fileObj = document.getElementById("FileUpload").files[0]; // js 获取文件对象
        if (typeof (fileObj) == "undefined" || fileObj.size <= 0) {
            alert("请选择图片");
            return;
        }
        var formFile = new FormData();
        formFile.append("action", "UploadVMKImagePath");
        formFile.append("file", fileObj); //加入文件对象
        var data = formFile;
        console.log(formFile);
        // $.ajax({
        //     url: "__CONTROLLER__/upload",
        //     data: data,
        //     type: "Post",
        //     dataType: "json",
        //     cache: false,//上传文件无需缓存
        //     processData: false,//用于对data参数进行序列化处理 这里必须false
        //     contentType: false, //必须
        //     success: function (result) {
        //         console.log(result);
        //         alert(result.msg);
        //         $("#video").val(result.data.file);
        //     }
        // })
    });
 
</script>
</body>
</html>